#coding:utf-8

import sys, urllib
from django_jinja import library


lib = library.Library()


@lib.filter
def add_stats(user_id, user_name, url):
    index = None
    if user_id == 4192:
        #婚礼达人
        index = 1
    if user_id == 4193:
        #婚礼设计师
        index = 2
    if user_id == 7518:
        #时尚新娘
        index = 3

    if index:
        return '_hmt.push(["_trackEvent", "%s", "pv", "%s"]);' % (user_name, url)
    else:
        return ''